<?php
	
	require_once("fta.201003310000/fta.php");
	fta_registerModules(
		array(
		"cms.201003310000/config/cmsConfig",//we will deprecate the old cms config soon..
		"site/components/MAIEvent",
		"site/components/MAIExhibition"
	));	
	
	$yearForCalendar = extractNumberWithKeyFromArray('yearForCalendar',$_REQUEST,date("Y"));
	
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="Keywords" content="<?php echo $metadataKeywords; ?>" />
<meta name="Description" content="<?php echo $metadataDescription; ?>" />

<title>Events and Exhibition | Mairangi Arts Centre</title>

<?php include ("includes/external-files.php"); ?>

<?// /* ?><link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0r4/build/calendar/assets/skins/sam/calendar.css">
<?php // */?>
<?php /* ?>
		<link rel="stylesheet" type="text/css" href="/css/calendar.css">
<?php */ ?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/yui/2.8.1/build/yahoo-dom-event/yahoo-dom-event.js"></script> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/yui/2.8.1/build/calendar/calendar-min.js"></script> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/yui/2.8.1/build/datasource/datasource-min.js"></script> 

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>




<link rel="stylesheet" type="text/css" href="/css/calendarGroup.css">
    
    
    
    
    
    
<?php include ("includes/analytics.php"); ?>   
</head>

<body id="about" class="yui-skin-sam">



<?php include ("includes/head.php"); ?>





<div id="container">


	<div id="content">
    	
        <h1>Events &amp; Exhibitions Calendar</h1>

         

            <div id="content-blocks">
        	                    


									<div class="year-select">
										<div class="year-select-ctrl">
											<a id="lastYear" href="#" class="prev" title="Previous Year">Previous Year</a> <strong id="currentYear"><?= $yearForCalendar ?></strong> <a id="nextYear"  href="#" class="next" title="Next Year">Next Year</a>
										</div>
									</div>





				<div id="calGroup-container1"></div>
                    
                    
				
				
				
				
				
				
				
				
				
				
				
<script>



	var calGroup = new YAHOO.widget.CalendarGroup("calGroup","calGroup-container1",{PAGES:12, pagedate: "01/<?= $yearForCalendar ?>"});

	var allBookingsForRoom = ["09\/10\/2010-09\/11\/2010","09\/12\/2010-09\/13\/2010","10\/01\/2010-10\/05\/2010","10\/06\/2010-10\/11\/2010","10\/12\/2010-10\/18\/2010"];

	
	for (var i=0, c=allBookingsForRoom.length; i < c; i++){
		calGroup.addRenderer(allBookingsForRoom[i], function(workingDate, cell) {
		    cell.innerHTML = '';
		    var a = document.createElement('a');
		    a.href="/html/admin-booking-selector.php?roomId=roomPrimaryKey&bookingDate=" + YAHOO.util.Date.format(workingDate,{format: '%F'});
		    a.innerHTML = '&nbsp;';
		    cell.appendChild(a);
		    YAHOO.util.Dom.addClass(cell, "booking"); 
	    	return YAHOO.widget.Calendar.STOP_RENDER; 
	    });
	}

	var onholdForRoom = ["09\/02\/2010-09\/03\/2010","09\/04\/2010-09\/05\/2010","09\/06\/2010-09\/07\/2010","09\/08\/2010-09\/09\/2010","09\/21\/2010-09\/23\/2010","10\/19\/2010-10\/22\/2010"];

	for (var i=0, c=onholdForRoom.length; i < c; i++){
		calGroup.addRenderer(onholdForRoom[i], function(workingDate, cell) {
		    cell.innerHTML = '';
		    var a = document.createElement('a');
		    a.href="/html/admin-booking-selector.php?roomId=roomPrimaryKey&bookingDate=" + YAHOO.util.Date.format(workingDate,{format: '%F'});
		    a.innerHTML = '&nbsp;';
		    cell.appendChild(a);
		    YAHOO.util.Dom.addClass(cell, "onholdBooking"); 
	    	return YAHOO.widget.Calendar.STOP_RENDER; 
	    });
	}		
	

	calGroup.render();
	
	YAHOO.util.Event.addListener('lastYear', 'click', function (e,el){
		el.previousYear();
		document.getElementById('currentYear').innerHTML = (new Date(el.pages[0].cfg.getProperty(YAHOO.widget.Calendar.DEFAULT_CONFIG.PAGEDATE.key))).getFullYear() ;	
	},calGroup);
	
	YAHOO.util.Event.addListener('nextYear', 'click', function (e,el){
		el.nextYear();
		document.getElementById('currentYear').innerHTML = (new Date(el.pages[0].cfg.getProperty(YAHOO.widget.Calendar.DEFAULT_CONFIG.PAGEDATE.key))).getFullYear() ;		
	},calGroup);	
</script>
				
				
				
				
				
				
				
				
				
				
				
				
                    
            </div><!-- Content-block ends -->

		</div><!-- Content-blocks ends -->
        
        
        
    
    
    



    </div><!-- Content ends -->








    
</div><!-- Container ends -->





<?php include ("includes/foot.php"); ?>



		


</body>

</html>
